package jsyf.oa.entity.inventory;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2018/10/23 0023.
 */
@Entity
@Table(name = "t_jxc_goods", schema = "oa", catalog = "")
public class GoodsEntity extends BaseEntity {
    private String tradeNo;
    private String tradeName;
    private String tradeUnit;
    private String category;
    private BigDecimal purchasePrice;
    private String remark;
    private String custom;
    private String createUserId;
    private String companyId;
    private String orgName;

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getTradeName() {
        return tradeName;
    }

    public void setTradeName(String tradeName) {
        this.tradeName = tradeName;
    }

    public String getTradeUnit() {
        return tradeUnit;
    }

    public void setTradeUnit(String tradeUnit) {
        this.tradeUnit = tradeUnit;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public BigDecimal getPurchasePrice() {
        return purchasePrice;
    }

    public void setPurchasePrice(BigDecimal purchasePrice) {
        this.purchasePrice = purchasePrice;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCustom() {
        return custom;
    }

    public void setCustom(String custom) {
        this.custom = custom;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID", this.getId());
        json.put("TRADE_NO", this.getTradeNo());
        json.put("TRADE_NAME", this.getTradeName());
        json.put("TRADE_UNIT", this.getTradeUnit());
        json.put("CATEGORY", this.getCategory());
        json.put("PURCHASE_PRICE", this.getPurchasePrice());
        json.put("REMARK", this.getRemark());
        json.put("CUSTOM", this.getCustom());
        json.put("CREATE_TIME", this.getCreateTime());
        json.put("CREATE_USER_ID", this.getCreateUserId());
        json.put("COMPANY_ID", this.getCompanyId());
        json.put("ORG_NAME", this.getOrgName());
        return json;
    }

    @Override
    public String getTableName() {
        return "t_jxc_goods";
    }

    @Override
    public String getViewName() {
        return "v_jxc_goods";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID", "Id");
        json.put("TRADE_NO", "tradeNo");
        json.put("TRADE_NAME", "tradeName");
        json.put("TRADE_UNIT", "tradeUnit");
        json.put("CATEGORY", "category");
        json.put("PURCHASE_PRICE", "purchasePrice");
        json.put("REMARK", "remark");
        json.put("CUSTOM", "custom");
        json.put("CREATE_TIME", "createTime");
        json.put("CREATE_USER_ID", "createUserId");
        json.put("COMPANY_ID", "companyId");
        json.put("ORG_NAME", "orgName");
        return json;
    }

}
